package com.gxuwz.ssy.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {



    @RequestMapping("/login")
    public String login(){
        return  "login";
    }


    @RequestMapping("/index")
    public String index(Authentication authentication){
        System.out.println(authentication);
        return "index";
    }


    @PreAuthorize("hasRole('normal')")
    @RequestMapping("/normal/index")
    public String adminIndex(){
        return "index";
    }

}
